<?php

use think\migration\Seeder;

class Partner extends Seeder
{
    /**
     * Run Method.
     *
     * Write your database seeder using this method.
     *
     * More information on writing seeders is available here:
     * http://docs.phinx.org/en/latest/seeding.html
     */
    public function run()
    {
        $faker = Faker\Factory::create('zh_CN');
        $data = [];
        // 循环生成50条数据
        for ($j = 0; $j < 50; $j++) {
            $data[] = [
                'logo'      => 'http://placeimg.com/100/100',
                'name'      => $faker->userName,
                'user_id'      => 1,
                'create_time'  => time(),
            ];
        }
        \think\Db::name('partner')->insertAll($data);
    }
}